var _table =null;
$(document).ready(function(){



	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	

	//添加验证
    $("#fr_appmessageinfo").validate({
        rules: {
			"amiType": {
				required: true
			},
			"amiTitle": {
				required: true
			},
			"amiAbstarct": {
				required: true
			},
			"amiStatus": {
				required: true
			}
        },
        onkeyup:false,
		focusCleanup:true,
		success:"valid",
    });
	
	$("#sub_mitbtn").on("click",function(){
		if($("#fr_appmessageinfo").valid()){
			var content = UE.getEditor('editor').getContent();
			if(!UE.getEditor('editor').hasContents()){
				layer.alert("请输入消息内容!");
				return false;
			}
			
			$("#amiContent").val(content);
			
			var json_str = $("#fr_appmessageinfo").serializeJson();
			var id = $("#id").val();
			if(id != ''){
				ajaxRequestJson("updateAppMessageInfo",json_str,function(sh_result){
					if(sh_result>0){
						show_alert('修改成功',function(){layer_close()});
					}
				});
			}else{
				ajaxRequestJson("saveAppMessageInfo",json_str,function(sh_result){
					if(sh_result>0){
						
						show_alert('保存成功',function(){layer_close()});
						
					}
				});
			}
		}
	})






});


